#include <iostream>
#include <string>
#include <algorithm> 
using namespace std;

int main() {
	string a;
	string b;
	cin>>a>>b;
	int i;
	reverse(a.begin(), a.end());
	reverse(b.begin(),b.end());
	int ra[201]={0};
	int rb[201]={0};
	int len1=a.length();
	int len2=b.length();
	for(i=0;i<len1;i++)	{
		ra[i]=a[i]-'0';
	}
	for(i=0;i<len2;i++)	{
		rb[i]=b[i]-'0';
	}
	int re[201]={0};
	int add=0;
	for(i=0;i<201;i++){
		int sum=ra[i]+rb[i]+add;
		re[i]=sum%8;
		add=sum/8;	
	}
	int flag=0;
	for(i=200;i>=0;i--){
		if(re[i]!=0){
			flag=1;
		}
		if(flag==1){
			cout<<re[i]<<"";
		}
	}
	if(flag==0){
		cout<<0;
	}
    return 0;
}

